<?php

return array(
	'ajaxUpdate' => false,
	'searchColumns' => array(
		'fid' => array('dropDownList', Yii::app()->enum->options('finance.financeAccount')),
		'worker_id' => array('dropDownList', Yii::app()->enum->options('worker.worker'),
			'visible' => 'Yii::app()->adminUser->role == AdminUser::ROLE_OPERATOR',
		),
	),

	'dataColumns' => array(
		'account.account',
		array(
			'name' => 'worker.worker_name',
			'visible' => Yii::app()->adminUser->role == AdminUser::ROLE_OPERATOR,
		),
		'amount',
		array(
			'name' => 'status',
			'value' => '$data->stateHandle->lookup()'
		),
		array(
			'class' => 'ButtonColumn',
			'header' => '操作',
			'stateHandles' => array(
				'stateHandle',
			),
		),
	),
	'scripts' => array(
		array(null, "
			$('.passed,.unpassed').bind('click',function() {
				$.dialog({
					'id': 'apply',
					'title': '审核记录',
					'padding': '10px 10px 0 10px'
				});
				dlg = $.dialog.get('apply');
				dlg.dom.content.find('form').live('submit', function() {
					$.post(this.action, $(this).serialize(), function(result) {
						if(result == 1) window.location.href = '".Yii::app()->controller->createUrl('admin')."';
						else
							dlg.content(result);
					});
					return false;
				});
				$.get($(this).attr('href'), {}, function(result) {
					dlg.content(result);
				});
				return false;
			});
		")
	),
	'_import' => array(
		array('*', 'actions.admin//*'),
	),
);
?>